<?php

use Monolog\Handler\StreamHandler;
use Monolog\Formatter\JsonFormatter;

return [

    /*
    |--------------------------------------------------------------------------
    | Default Log Channel
    |--------------------------------------------------------------------------
    |
    | This option defines the default log channel that gets used when writing
    | messages to the logs. The name specified in this option should match
    | one of the channels defined in the "channels" configuration array.
    |
    */

    'default' => env('LOG_CHANNEL', 'stack'),

    /*
    |--------------------------------------------------------------------------
    | Log Channels
    |--------------------------------------------------------------------------
    |
    | Here you may configure the log channels for your application. Out of
    | the box, Laravel uses the Monolog PHP logging library. This gives
    | you a variety of powerful log handlers / formatters to utilize.
    |
    | Available Drivers: "single", "daily", "slack", "syslog",
    |                    "errorlog", "monolog",
    |                    "custom", "stack"
    |
    */

    'channels' => [
        'request' => [
            'driver' => 'daily',
            'path' => storage_path('logs/request-info.log'),
            'level' => 'info',
            'days' => 5,
            'handler' => StreamHandler::class,
            'formatter' => JsonFormatter::class,
            'value_max_length' => env('REQUEST_LOG_VALUE_MAX_LENGTH', 300),
        ],
        'single' => [
            'driver' => 'single',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
            'permission' => 0666
        ],

        'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
            'days' => 7,
            'permission' => 0666
        ],
        'heartbeat' => [
            'driver' => 'daily',
            'path' => storage_path('logs/heartbeat.php'),
            'level' => 'debug',
            'days' => 7,
            'permission' => 0666
        ],
        'errorlog' => [
            'driver' => 'errorlog',
            'level' => 'debug',
        ],
    ],

];
